package com.okaixz.common.utils;

public class BitUtils {
    public static int getBit(int num, int index) {
        return (num >> index) & 1;
    }

    /**
     * 设置第index位为1
     *
     * @param num
     * @param index
     * @return
     */
    public static int setBit1(int num, int index) {
        return num | (1 << index);
    }
}
